﻿//文档就绪函数
$(function () {
    //select()
    //IngredientSelect()

    $("#SCNumber").val("SC202501121942")
    $("#KHMC").val("李四")
    $("#DDNumber").val("SC202501121542")
    $("#DDLY").val("北京市昌平区回龙观镇")
    $("#DeliveryDate").val("2025-01-02 19:44::23")
    $("#Notes").val("备注信息")
    $("#CreatedDate").val("2025-01-02 19:42::16")
    $("#CreatedBy").val("张三")
    $("#EndDate").val("2025-01-02 19:46:33")
    $("#EndPerson").val("张三")
});


//添加生产信息
window.AddProductionPlan = function AddProductionPlan() {
    var layer = layui.layer;
    var form = layui.form;
    var $ = layui.jquery;
    var objTwo = {
        Id: 1,
        PlannedProduction: 20,
        ReportingNum: 0
    };

    $.ajax({
        url: '../Manufacture/AddProductionPlanInfo',
        type: "Post",
        headers: {
            "Authorization": localStorage.getItem("token")
        },
        data: {
            dto: objTwo
        },
        success: function (res) {
            //
            //
            console.log(res);
            var response = JSON.parse(res);
            if (response.Code === 1) {
                layer.alert("添加成功");
                setTimeout(function () {
                    //window.location.href = "";
                }, 2000);
            } else {
                layer.msg('添加失败：' + response.message, { icon: 2 });
            }
        },
        error: function () {
            layer.msg('添加失败,请稍后重试', {
                time: 2000,
                icon: 2
            });
        }
    });
}